//
//  UIButton+Extension.swift
//  Weibo201655
//
//  Created by pro on 16/5/10.
//  Copyright © 2016年 LeeDan. All rights reserved.
//

import Foundation
import UIKit

extension UIButton {
    
    convenience init(imgName: String, bgImgName: String = "timeline_card_bottom_background", title: String) {
        self.init()
        
        setBackgroundImage(UIImage(named: bgImgName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: bgImgName + "_highlighted"), forState: UIControlState.Highlighted)
        
        setImage(UIImage(named: imgName), forState: UIControlState.Normal)
        
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.lightGrayColor(), forState: UIControlState.Normal)
    }
    
}